package com.chenwy.example;

import org.apache.commons.lang3.StringUtils;
import org.springframework.web.util.UriComponents;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.web.util.UriUtils;
import org.springframework.web.util.UrlPathHelper;

import java.net.URI;
import java.net.URISyntaxException;
import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * Created by Administrator on 2019/5/7.
 */
public class Test {

    public static void main(String[] args) {
        Queue<Integer> queue = new PriorityQueue<Integer>();
        queue.add(1);
        queue.add(-1);
        queue.add(3);
        System.out.println(queue.peek());
        List<Integer> list = new ArrayList<Integer>();
        list.add(1);
        list.add(3);
        list.add(4);
        list.add(0,-1);
        System.out.println(list);
        String url = "http://tq.ifjing.com/static/app/weather/tool/info.html?act=505&cAct=4&id=7673333&model=season&tagName=%E8%8A%82%E6%97%A5%E8%8A%82%E6%B0%94&infoTag=9&shareType=4&infoFrom=2&categoryId=1148";

        URI uri = URI.create(url);
        String query = uri.getQuery();
        Map<String,Object> map = new HashMap<String,Object>();
        if(StringUtils.isNotEmpty(query)){
            String [] params = query.split("&");
            for(String param : params){
                String [] keyValue = param.split("=");
                if(keyValue.length > 0){
                    map.put(keyValue[0] ,keyValue.length > 1 ? keyValue[1] : "");
                }

            }
        }
        System.out.println(map);
        String [] abs = {"1","2","3"};
        List<String> abc = Arrays.asList(abs);
        System.out.println(abc.size());
    }
}
